import os

import pytest

from utils.readYamlFile import ReadYamlFile

if __name__ == '__main__':
    # 版本号
    version = 'V20231201'
    # 当前版本首次执行全量用例，执行前先清空用例状态
    # data = ReadYamlFile().read_yaml('case_state.yaml')
    # ignore_case_init = {'passed': [], 'failed': [], 'skipped': [case for case in data['skipped']]}
    # ReadYamlFile.write_yaml('case_state.yaml', ignore_case_init)
    # 增量执行
    # '-n', '2', 分布式执行
    # 'reruns', '1', '--reruns-delay', '1', 失败重跑
    pytest.main(['./script',
                 f'--alluredir=./report/allure-results-{version}'])
    # 生成报告
    os.system(
        f'allure generate ./report/allure-results-{version} -o ./report/allure-report-{version} --clean')
